package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IcPartyApplicantsMapper;
import com.ruoyi.system.domain.IcPartyApplicants;
import com.ruoyi.system.service.IIcPartyApplicantsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 入党积极分子Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class IcPartyApplicantsServiceImpl implements IIcPartyApplicantsService 
{
    @Autowired
    private IcPartyApplicantsMapper icPartyApplicantsMapper;

    /**
     * 查询入党积极分子
     * 
     * @param applicantId 入党积极分子主键
     * @return 入党积极分子
     */
    @Override
    public IcPartyApplicants selectIcPartyApplicantsByApplicantId(Long applicantId)
    {
        return icPartyApplicantsMapper.selectIcPartyApplicantsByApplicantId(applicantId);
    }

    /**
     * 查询入党积极分子列表
     * 
     * @param icPartyApplicants 入党积极分子
     * @return 入党积极分子
     */
    @Override
    public List<IcPartyApplicants> selectIcPartyApplicantsList(IcPartyApplicants icPartyApplicants)
    {
        return icPartyApplicantsMapper.selectIcPartyApplicantsList(icPartyApplicants);
    }

    /**
     * 新增入党积极分子
     * 
     * @param icPartyApplicants 入党积极分子
     * @return 结果
     */
    @Override
    public int insertIcPartyApplicants(IcPartyApplicants icPartyApplicants)
    {
        icPartyApplicants.setCreateTime(DateUtils.getNowDate());
        return icPartyApplicantsMapper.insertIcPartyApplicants(icPartyApplicants);
    }

    /**
     * 修改入党积极分子
     * 
     * @param icPartyApplicants 入党积极分子
     * @return 结果
     */
    @Override
    public int updateIcPartyApplicants(IcPartyApplicants icPartyApplicants)
    {
        icPartyApplicants.setUpdateTime(DateUtils.getNowDate());
        return icPartyApplicantsMapper.updateIcPartyApplicants(icPartyApplicants);
    }

    /**
     * 批量删除入党积极分子
     * 
     * @param applicantIds 需要删除的入党积极分子主键
     * @return 结果
     */
    @Override
    public int deleteIcPartyApplicantsByApplicantIds(String applicantIds)
    {
        return icPartyApplicantsMapper.deleteIcPartyApplicantsByApplicantIds(Convert.toStrArray(applicantIds));
    }

    /**
     * 删除入党积极分子信息
     * 
     * @param applicantId 入党积极分子主键
     * @return 结果
     */
    @Override
    public int deleteIcPartyApplicantsByApplicantId(Long applicantId)
    {
        return icPartyApplicantsMapper.deleteIcPartyApplicantsByApplicantId(applicantId);
    }
}
